<template>
    <div class="main_b main_s_o">
        <checklist :options="commonList" label-position="left" :max="1" @on-change="change" v-model="checks"></checklist>
    </div>
</template>
<script>
    import { Checklist } from 'vux'
    export default {
        name: 'pay',
        props: [],
        components: { Checklist },
        data: function () {
            return {
                commonList: [],
                checks: ['2'],
                checkH: ['2']
            }
        },
        activated(){
            var a = {key: '1', value: '<span class="wx_s_icon" style="margin-right:0.22rem "></span>微信支付'}
            var b = {key: '2', value: '<span class="alipay_s_icon" style="margin-right:0.22rem "></span>支付宝支付'}
            if(this.comJS.checkIsNewEdition()){
                this.commonList = [a, b]
            } else {
                this.commonList = [b]
            }
            this.checks = ['2']
            this.checkH = ['2']
        },
        methods: {
            change(value,label){
                this.$emit('change', value)
            }
        },
        watch: {
            show: function () {
                console.log(1)
                this.checks = ['2']
            },
            checks: function () {
                if(!this.checks.length){
                    this.checks = [this.checkH[0]]
                } else {
                    this.checkH = this.checks
                }
            }
        }
    }
</script>
<style scoped>
    .main_b {
        background: #fff;
    }
</style>